package org.peterbjornx.net.packet;

import org.peterbjornx.io.RSInputStream;
import org.peterbjornx.Client;
import org.peterbjornx.model.Player;

import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: PeterbjornX
 * Date: Apr 10, 2009
 * Time: 1:39:52 PM
 * >
 */
public class ClientInit implements Packet{
    public void handleData(RSInputStream instream, Client clientinstance, int psize) throws IOException {
        clientinstance.members = instream.read() - 128 & 0xff;
        clientinstance.myplayerindex = instream.readUnsignedWordBigEndianA();
        clientinstance.myplayer = clientinstance.playerArray[clientinstance.myplayerindex] = new Player();
    }
}
